using System;
using System.Collections.Generic;
using Dict.DataModel;

namespace Dict.Dao
{
    public class TableWorldSeedDao:DaoBase<TableWorldSeed>
    {
        public override void AddPrimaryIndex(TableWorldSeed model)
        {
            cachePrimary[model.id.ToString()] = model;
        }

        public override string GetFileName()
        {
            return "TableWorldSeed.txt";
        }

        protected override TableWorldSeed ParseRowData(string[] rowData)
        {
            TableWorldSeed data = new TableWorldSeed();
			data.id = rowData [0];
			data.desc = rowData [1];
			data.groupId = rowData [2];
			data.groupName = rowData [3];

            if (string.IsNullOrEmpty(rowData[4]))
            {
                data.type = 0;
            }
            else
            {
                data.type = int.Parse(rowData[4]);
            }
			data.get = rowData [5];
			data.cost = rowData [6];

            return data;
        }


        public override void AddOneIndex(TableWorldSeed model)
        {
            if (!cacheOneIndex.ContainsKey(model.groupId.ToString()))
            {
                cacheOneIndex[model.groupId.ToString()] = new List<TableWorldSeed>();
            }
            cacheOneIndex[model.groupId.ToString()].Add(model);
        }
    

    }

}
